using System;
using System.Xml;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Collections.Generic;

/* Generated with http://xmltocs.com/ */
namespace MVCGeneratorXMLXML
{
    public class MVCGeneratorXMLEntityTypes
    {
        public MVCGeneratorXMLEntityTypes()
        {
            Columns = new List<Column>();
        }

        // Attributes
        public String Project { get; set; }
        public String EntityContainer { get; set; }
        public String EntityType { get; set; }

        // Multi Instace objects
        public List<Column> Columns { get; set; }

        public static MVCGeneratorXMLEntityTypes CreateNewMVCGeneratorXMLEntityTypes(System.Xml.XmlNode Node)
        {
            MVCGeneratorXMLEntityTypes NewMVCGeneratorXMLEntityTypes = new MVCGeneratorXMLEntityTypes();

            foreach (XmlAttribute Attribute in Node.Attributes)
            {
                switch (Attribute.Name)
                {
                    case "Project":
                         NewMVCGeneratorXMLEntityTypes.Project = Attribute.Value;
                         break;
                    case "EntityContainer":
                         NewMVCGeneratorXMLEntityTypes.EntityContainer = Attribute.Value;
                         break;
                    case "EntityType":
                         NewMVCGeneratorXMLEntityTypes.EntityType = Attribute.Value;
                         break;
                    default:
                        break;
                }
            }

            foreach (XmlNode ChildNode in Node.ChildNodes)
            {
                switch (ChildNode.Name)
                {
                    case "Column":
                        Column NewLocalColumn = Column.CreateNewColumn(ChildNode);
                        NewMVCGeneratorXMLEntityTypes.Columns.Add(NewLocalColumn);
                        break;

                    default:
                        break;
                }
            }

            return NewMVCGeneratorXMLEntityTypes;
        }
    }
}
